package fr.inserm.u915.tabixserver;

public class EnsemblNameNormalizer implements ChromNameNormalizer
	{
	@Override
	public String normalize(String s)
		{
		if(	s.equals("23") ||
			s.equalsIgnoreCase("X") ||
			s.equalsIgnoreCase("chrX"))
			{
			return "X";
			}
		else if(
				s.equals("24") ||
				s.equalsIgnoreCase("Y") ||
				s.equalsIgnoreCase("chrY")
				)
			{
			return "Y";
			}
		else if(	s.equals("25") ||
			s.equalsIgnoreCase("M") ||
			s.equalsIgnoreCase("MT") ||
			s.equalsIgnoreCase("chrM")
			)
			{
			return "MT";
			}
		if(s.startsWith("chr")) s=s.substring(3);
		while(s.startsWith("0")) s=s.substring(1);
		return s;
		}
	}
